<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html>
<head>
    <title>终端列表</title>
    <meta name="menu" content="allTerminal"/>

    <script type="text/javascript">
          $(document).ready(function(){
              $("#grad").change(function(){
                    searchPage();
              }) ;

              $("#excelExport").click(function(){
                  var mainForm = $("#mainForm");
                  mainForm.attr("action","terminal!listExp.action");
                  mainForm.submit();
                  mainForm.attr("action","terminal.action");
              })
          })
    </script>
</head>

<body>
<div class="content_block">
    <h2 class="jquery_tab_title">终端列表</h2>
    <form action="terminal.action" method="post" id="mainForm">
        <input type="hidden" id="fileDownloadToken" name="fileDownloadToken">
        <div>
            <p>
                <label class="inline">创建人:</label>
                <input name="filter.createName" type="text" value="${filter.createName}"
                       class="input-small" />
                <label class="inline">创建时间 从:</label>
                <input class="input-small flexy_datepicker_input" type="text" name="filter.startTimeFrom"
                       value="<s:date name='filter.startTimeFrom' format='yyyy-MM-dd'/>">
                <label class="inline">到:</label>
                <input class="input-small flexy_datepicker_input" type="text" name="filter.startTimeTo"
                       value="<s:date name='filter.startTimeTo' format='yyyy-MM-dd'/>">
                <label class="inline">评分:</label>
                <code:dispCodeList id="grad" codeType="GRAD" name="filter.grade" displayHeader="true"
                                   codeValue="${filter.grade}" cssClass="input-small"/>

                <a href="#" class="button" onclick="searchPage()">查询</a>
            </p>
            <table width="100%" cellpadding="0" id="table_liquid" cellspacing="0">
                <thead>
                <tr>
                    <th><a href="javascript:sort('tm.title','asc')" scope="col">标题</a></th>
                    <th><a href="javascript:sort('tm.content','asc')" scope="col">内容</a></th>
                    <th><a href="javascript:sort('createUser.first_','asc')" scope="col">创建人</a></th>
                    <th><a href="javascript:sort('tm.create_time','asc')" scope="col">创建时间</a></th>
                    <th><a href="javascript:sort('tm.expect_time','asc')" scope="col">预期完成时间</a></th>
                    <th><a href="javascript:sort('tm.end_time','asc')" scope="col">实际完成时间</a></th>
                    <th><a href="javascript:sort('task.name_','asc')" scope="col">当前流程状态</a></th>
                    <th><a href="javascript:sort('task.assignee_','asc')" scope="col">当前处理人</a></th>
                    <th><a href="javascript:sort('task.due_date_','asc')" scope="col">任务过期时间</a></th>
                    <th><a href="javascript:sort('tm.grade','asc')" scope="col">评分</a></th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <s:iterator value="page.result">
                    <tr <c:if test="${overDue}"> class="warn"</c:if>>
                        <td><stringDisplay:short length="5" fullText="${title}"/>&nbsp;</td>
                        <td><stringDisplay:short length="10" fullText="${content}"/>&nbsp;</td>
                        <td>${createName}&nbsp;</td>
                        <td><fmt:formatDate value="${createTime}" pattern="yyyy-MM-dd"/>&nbsp;</td>
                        <td><fmt:formatDate value="${expectTime}" pattern="yyyy-MM-dd"/>&nbsp;</td>
                        <td><fmt:formatDate value="${endTime}" pattern="yyyy-MM-dd"/>&nbsp;</td>
                        <td>${taskName}&nbsp;</td>
                        <td>${userFullName}&nbsp;</td>
                        <td><fmt:formatDate value="${dueDate}" pattern="yyyy-MM-dd"/>&nbsp;</td>
                        <td>${grade}&nbsp;</td>
                        <td width="90">
                            <a href="terminal!view.action?id=${id}" title="查看">查看</a>
                        </td>
                    </tr>
                </s:iterator>
                <tr>
                    <td colspan="4" class="tdButton">
                        <c:if test="${page.totalCount>0}">
                        <a href="#"  id="excelExport" class="button">导出Excel</a>
                         </c:if>
                        <security:authorize ifAnyGranted="A_终端业务提报">
                        <a href="terminal!input.action" class="button">业务提报</a>
                         </security:authorize>
                    </td>
                    <td colspan="7" class="pagination">
                        <%@ include file="/common/pagination.jsp" %>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </form>
</div>
<!--end content_block-->

</body>
</html>
